<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','Admin');
?>
<div class="pad-10">
<form name="searchform" action="<?php echo __APP__; ?>" method="get" >
<input type="hidden" value="<?php echo MODULE_NAME; ?>" name="m">
<input type="hidden" value="<?php echo CONTROLLER_NAME ?>" name="c">
<input type="hidden" value="<?php echo ACTION_NAME ?>" name="a">
<input type="hidden" value="<?php echo $modelid;?>" name="modelid">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td align="center">
		<div class="explain-col">
				<select name="field">
					<option value='title' <?php if($_GET['field']=='title') echo 'selected';?>>标题</option>
					<option value='keywords' <?php if($_GET['field']=='keywords') echo 'selected';?> >关键字</option>
					<option value='description' <?php if($_GET['field']=='description') echo 'selected';?>>描述</option>
					<option value='id' <?php if($_GET['field']=='id') echo 'selected';?>>ID</option>
				</select>
				<?php $form::select_category($catid,'name="catid"', L('no_limit_category'), $modelid,0,1);?>
				
				<input name="keywords" type="text" value="<?php echo stripslashes($_GET['keywords'])?>" style="width:330px;" class="input-text" />
				<input type="submit" name="dosubmit" class="button" value="<?php echo L('search');?>" />
		</div>
		</td>
		</tr>
    </tbody>
</table>
</form>
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th  align="left" width="20"><input type="checkbox" value="" id="check_box" onclick="selectall('userid[]');"></th>
			<th align="left">ID</th>
			<th align="left">标题</th>
			<th align="left">作者</th>
			<th align="left">状态</th>
			<th align="left">发布时间</th>
		</tr>
	</thead>
<tbody>
<?php
	if(is_array($infos)){
	foreach($infos as $k=>$v) {
?>
    <tr onclick="select_list(this, '<?php echo $v['title'] ?>', '<?php echo $v['id'] ?>');" class="item">
		<td align="left"><input type="checkbox" value="<?php echo $v['userid']?>" name="userid[]"></td>
		<td align="left"><?php echo $v['id'] ?></td>
		<td align="left"><?php echo $v['title'] ?></td>
		<td align="left">
		<?php
		if($v['sysadd']==0) {
			echo "<a href='".U('Member/member/memberinfo', array('username' => urlencode($v['username'])))."' >".$v['username']."</a>"; 
			echo '<img src="'.IMG_PATH.'icon/contribute.png" title="'.L('member_contribute').'">';
		} else {
			echo $v['username'];
		}
		?>			
		</td>
		<td align="left"><?php if($v['status'] == 0 || $v['status'] == 99){?><font color="red"><?php echo L('unpassed');?></font><?php }else{?><?php echo L('passed');?><?php }?></td>
		
		<td align="left"><?php echo dgmdate($v['inputtime']) ?></td>
    </tr>
<?php
	}
}
?>
</tbody>
</table>
   <div id="pages"><?php echo $pages;?></div>
</div>
</div>
<style type="text/css">
 .line_ff9966,.line_ff9966:hover td{
	background-color:#FF9966;
}
 .line_fbffe4,.line_fbffe4:hover td {
	background-color:#fbffe4;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var result_id = "<?php echo I('obj', 'company') ?>";
function select_list(obj,title,id) {
	$(".item").removeClass('line_ff9966');
	$(obj).addClass("line_ff9966");
	window.parent.$('#' + result_id + '_text').attr('value', title);
	window.parent.$('#' + result_id + '_id').attr("value", id);	
}
//-->
</SCRIPT>
</body>
</html>